/*     */ package com.cr.business;
/*     */ 
/*     */ import com.cr.business.domain.CrQuestion;
/*     */ import com.cr.business.service.ICrQuestionService;
/*     */ import com.cr.business.service.ICrUserService;
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.common.utils.poi.ExcelUtil;
/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/business/question"})
/*     */ public class CrQuestionController extends BaseController {
/*  34 */   private String prefix = "business/question";
/*     */   
/*     */   @Autowired
/*     */   private ICrQuestionService crQuestionService;
/*     */   
/*     */   @Autowired
/*     */   private ICrUserService userService;
/*     */   
/*     */   @RequiresPermissions({"business:question:view"})
/*     */   @GetMapping
/*     */   public String question(ModelMap mmap) {
/*  46 */     mmap.put("userList", this.userService.selectCrUserList(null));
/*  47 */     return this.prefix + "/question";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(CrQuestion crQuestion) {
/*  58 */     startPage();
/*  59 */     List<CrQuestion> list = this.crQuestionService.selectCrQuestionList(crQuestion);
/*  60 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:export"})
/*     */   @Log(title = "法律问答--问题", businessType = BusinessType.EXPORT)
/*     */   @PostMapping({"/export"})
/*     */   @ResponseBody
/*     */   public AjaxResult export(CrQuestion crQuestion) {
/*  72 */     List<CrQuestion> list = this.crQuestionService.selectCrQuestionList(crQuestion);
/*  73 */     ExcelUtil<CrQuestion> util = new ExcelUtil(CrQuestion.class);
/*  74 */     return util.exportExcel(list, "法律问答--问题数据");
/*     */   }
/*     */   
/*     */   @GetMapping({"/add"})
/*     */   public String add(ModelMap mmap) {
/*  83 */     mmap.put("userList", this.userService.selectCrUserList(null));
/*  84 */     return this.prefix + "/add";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:add"})
/*     */   @Log(title = "法律问答--问题", businessType = BusinessType.INSERT)
/*     */   @PostMapping({"/add"})
/*     */   @ResponseBody
/*     */   public AjaxResult addSave(CrQuestion crQuestion) {
/*  96 */     return toAjax(this.crQuestionService.insertCrQuestion(crQuestion));
/*     */   }
/*     */   
/*     */   @GetMapping({"/edit/{questionId}"})
/*     */   public String edit(@PathVariable("questionId") Long questionId, ModelMap mmap) {
/* 105 */     CrQuestion crQuestion = this.crQuestionService.selectCrQuestionByQuestionId(questionId);
/* 106 */     mmap.put("crQuestion", crQuestion);
/* 107 */     mmap.put("userList", this.userService.selectCrUserList(null));
/* 108 */     return this.prefix + "/edit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:edit"})
/*     */   @Log(title = "法律问答--问题", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/edit"})
/*     */   @ResponseBody
/*     */   public AjaxResult editSave(CrQuestion crQuestion) {
/* 120 */     return toAjax(this.crQuestionService.updateCrQuestion(crQuestion));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:remove"})
/*     */   @Log(title = "法律问答--问题", businessType = BusinessType.DELETE)
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/* 132 */     return toAjax(this.crQuestionService.deleteCrQuestionByQuestionIds(ids));
/*     */   }
/*     */   
/*     */   @GetMapping({"/audit/{questionId}"})
/*     */   public String audit(@PathVariable("questionId") Long questionId, ModelMap mmap) {
/* 141 */     CrQuestion crQuestion = this.crQuestionService.selectCrQuestionByQuestionId(questionId);
/* 142 */     mmap.put("crQuestion", crQuestion);
/* 143 */     return this.prefix + "/audit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:question:edit"})
/*     */   @Log(title = "法律问答--问题", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/audit"})
/*     */   @ResponseBody
/*     */   public AjaxResult auditSave(CrQuestion crQuestion) {
/* 155 */     return toAjax(this.crQuestionService.updateCrQuestion(crQuestion));
/*     */   }
/*     */   
/*     */   @GetMapping({"/info/{questionId}"})
/*     */   public String info(@PathVariable("questionId") Long questionId, ModelMap mmap) {
/* 164 */     CrQuestion crQuestion = this.crQuestionService.selectCrQuestionByQuestionId(questionId);
/* 165 */     mmap.put("crQuestion", crQuestion);
/* 166 */     mmap.put("userList", this.userService.selectCrUserList(null));
/* 168 */     return this.prefix + "/info";
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\business\CrQuestionController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */